package com.cuit.zuke.order.client;

import com.cuit.zuke.product.model.entity.Goods;
import com.cuit.zuke.product.model.entity.Stock;
import com.cuit.zuke.product.model.entity.Warehouse;
import io.swagger.models.auth.In;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("zuke-product")
public interface ProductFeignClient {

    @GetMapping(value = "/product/goods/findByIdCli/{id}")
    Goods findByIdCli(@PathVariable Long id);

    @PostMapping(value = "/product/goods/findByIdClis")
    List<Goods> findByIdClis(@RequestBody List<Long> goodsIds);

    @GetMapping(value = "/product/warehouse/findAllCli")
    List<Warehouse> listWarehouseCli();

    @GetMapping(value = "/product/stock/getByWarehouseId/{warehouseId}")
    List<Stock> getByStockWarehouseIdCli(@PathVariable Integer warehouseId);

    @GetMapping(value = "/product/stock/reduceStock/{stockId}/{num}")
    void reduceStock(@PathVariable(value = "stockId") Long stockId,@PathVariable(value = "num") Integer num);

    @GetMapping(value = "/product/warehouse/getNameById/{warehouseId}")
    String getWarehouseNameById(@PathVariable("warehouseId") Integer warehouseId);
}
